/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 4; tab-width: 4 -*- */
/*
 * Projects
 * Copyright (C) Arnaud Duval 2010 <arnaud.duval@gmail.com>
 * 
 * Projects is free software: you can redistribute it and/or modify it
 * under the terms of the GNU General Public License as published by the
 * Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 * 
 * Projects is distributed in the hope that it will be useful, but
 * WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 * See the GNU General Public License for more details.
 * 
 * You should have received a copy of the GNU General Public License along
 * with this program.  If not, see <http://www.gnu.org/licenses/>.
 */

#ifndef _ACTIVITY_TYPES_HPP_
#define _ACTIVITY_TYPES_HPP_

#include <string>
#include <libxml++/libxml++.h>
#include <fstream>

///@class ActivityTypes
///@brief List the available activity types
class ActivityTypes
{
	public:
		//Constructeur
		ActivityTypes();
		//Constructeur par recopie
		ActivityTypes(const ActivityTypes&);
		//Constructeur en précisant la taille
		ActivityTypes(unsigned int);
		//Destructeur
		~ActivityTypes();
		//Retourne l'index d'un type d'activité donné
		int Index(std::string);
		//Retourne l'intitulé d'une activité en fonction de son index
		std::string Type(unsigned int);
		///@brief Ajoute une nouvelle activité
		bool Add(std::string);
		//vérifie si un intitulé d'activité existe
		bool Exists(std::string);
		//retourne le nombre de type enregistré
		unsigned int NbTypes();
		//Surcharge de l'opérateur =
		ActivityTypes &operator=(const ActivityTypes&);
		//Read information form a XML node
		void ReadXMLNode(xmlpp::Node*);
		//Write to XML file
		void WriteXML(std::ofstream&);
		///@brief Clear the list of activity types
		void Clear();
	protected:

	private:
		unsigned int nbTypes;
		std::string *types;
};

#endif // _ACTIVITY_TYPES_HPP_
